Skip to content

Conversation

@arome
Copy link
Contributor

@arome arome commented Feb 4, 2026

Added option to disable iModel action depending on the iModel
image image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the ability to conditionally disable iModel context menu actions based on the iModel's properties by accepting a callback function for the disabled prop.

Changes:

  • Modified ContextMenuBuilderItem interface to allow disabled to be either a boolean or a callback function that receives the iModel value
  • Updated the menu building logic to evaluate the disabled prop dynamically when it's a function
  • Added a new Storybook story demonstrating the disabled callback functionality

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/modules/imodel-browser/src/utils/_buildMenuOptions.tsx Extended the ContextMenuBuilderItem interface to support callback functions for the disabled prop and updated the menu builder to evaluate it
packages/apps/storybook/src/imodel-browser/IModelGrid.stories.tsx Added example story showing disabled actions based on iModel properties and improved alert message formatting
common/changes/@itwin/imodel-browser-react/omar-disable-imodel-action-callback_2026-02-04-21-29.json Added changelog entry for the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@arome arome requested a review from Copilot February 4, 2026 22:12
@arome arome requested a review from ben-polinsky as a code owner February 4, 2026 22:12
@arome arome enabled auto-merge (squash) February 4, 2026 22:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arome arome merged commit 3265b6c into main Feb 4, 2026
5 checks passed
@arome arome deleted the omar/disable-imodel-action-callback branch February 4, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants